package com.persondemo.videoappliction.ui.adapter;

import android.content.Context;
import android.content.Intent;
import android.support.annotation.Nullable;
import android.view.View;
import android.widget.ImageView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.persondemo.videoappliction.R;
import com.persondemo.videoappliction.bean.VideoBean;
import com.persondemo.videoappliction.utils.ImageLoaderUtil;

import java.util.List;

/**
 * Created by Administrator on 2018/3/27.
 */

public class YouLikeAdapter extends BaseQuickAdapter<VideoBean.DataBean.LikelistBean, BaseViewHolder> {
    private Context mContext;

    public YouLikeAdapter(@Nullable List<VideoBean.DataBean.LikelistBean> data, Context mContext) {
        super(R.layout.module_include_recycle, data);
        this.mContext = mContext;
    }
    @Override
    protected void convert(BaseViewHolder helper, VideoBean.DataBean.LikelistBean item) {
//       helper.setText(R.id.recler_base_text,)
        ImageLoaderUtil.LoadImage(mContext, item.getImgs(), (ImageView) helper.getView(R.id.recler_base_img));
        helper.setText(R.id.recler_base_name, item.getName());
        if (item.getType().equals("电影")){
            helper.setText(R.id.recler_base_text,item.getPing());
        }else {
            helper.setText(R.id.recler_base_text, item.getJishu());
        }

    }
}
